<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="css/weui.min.css" />
    <link rel="stylesheet" type="text/css" href="css/jquery-weui.min.css" />
    <link rel="stylesheet" type="text/css" href="css/index.css" />
    <link rel="stylesheet" type="text/css" href="css/mine.css" />
    <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_546019_o8qxm6fupb0ggb9.css" />
    <title>供应链</title>
    <script src="js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/jquery-weui.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/baseConfig.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/swiper.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/city-picker.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" type="text/javascript" charset="utf-8"></script>
</head>
<style type="text/css">
    .weui-list {
        width: 100%;
        height: auto;
        overflow: hidden;
        margin-top: 5rem;
    }
    
    .weui-list li {
        width: 47%;
        height: 7.5rem;
        text-align: center;
        background: #fff;
        float: left;
        -webkit-box-shadow: 0 0 0.1rem 0.05rem #b4b4b4;
        -moz-box-shadow: 0 0 0.1rem 0.05rem #b4b4b4;
        box-shadow: 0 0 0.1rem 0.05rem #b4b4b4;
        position: relative;
        box-sizing: border-box;
        margin: 1%
    }
    
    .weui-list li i {
        width: 1rem;
        height: 1rem;
        border-radius: 50%;
        background: #f65555;
        position: absolute;
        right: 0.4rem;
        top: 0.4rem;
        font-size: 0.75rem;
        color: #fff;
        text-align: center;
        line-height: 1rem;
        font-style: normal
    }
    
    .weui-list li img {
        width: 2.1rem;
        height: 2.2rem;
        margin-top: 1.8rem
    }
    
    .mine-content {
        background: url('img/bgImage.png') no-repeat;
        background-size: 100% 100%
    }
    
    .weui-list li a {
        color: #666;
        width: 100%;
        height: 100%;
        font-size: 0.85rem;
        display: inline-block;
    }
    
    .weui-list li a span {
        margin-top: 0.6rem;
        display: inline-block;
        color: #444;
    }
    
    .weui-list li:nth-child(odd) {
        /* margin-right: 0.45rem; */
    }
    
    .mine-content .company-name {
        border-bottom: 0
    }
    
    .mine-content .company-name p:last-child {
        margin-bottom: 0
    }
</style>

<body>
    <!--<div id="header">
        <div class="header-title" style="position: fixed;top: 0;">
            <!--<img src="img/left.png" class="left" />-->
            <!--<span>供应链</span>
        </div>
    </div>-->

    <div class="mine-content" style="margin-top: 0;">
        <div class="company-name">
            <p>
                <span class="names" style="color: #444"></span>
                <img src="img/right.png" />
            </p>
            <p style="height: auto;">
                <span class="main-type" style="color: #777;font-family: 'pfr'"></span>
            </p>
        </div>
        <ul class="weui-list">
            <li style="margin-bottom: 0.45rem">
                <i class="orderNum"></i>
                <a href="html/order/orderList.html">
                    <img src="img/index1.png" alt=""><br />
                    <span>订单管理</span>
                </a>
            </li>
            <li style="margin-bottom: 0.45rem">
                <a href="html/order/materialList.html">
                    <img src="img/index2.png" alt=""><br />
                    <span> 提交议价单</span>
                </a>
            </li>
            <li>
                <a href="html/mine/mine.html">
                	<i class="waitNum"></i>
                    <img src="img/index3.png" alt=""><br />
                    <span>待办中心</span>
                </a>
            </li>
            <li>
                <a href="html/order/applyPay.html">
                	<i class="applyPay"></i>
                    <img src="img/index4.png" alt=""><br />
                    <span>申请付款</span>
                </a>
            </li>
        </ul>
    </div>
</body>
<script type="text/javascript">
    var SupplierId = localStorage.getItem("SupplierId")
    var phone = localStorage.getItem("username")
    if (!phone) {
        $.confirm("尚未登录，是否去登录", function() {
            //点击确认后的回调函数
            window.location.href = "html/login/login.html"
        }, function() {
            //点击取消后的回调函数
        });
    } else {
        $(".company-name .names").html(localStorage.getItem("name"))
        $(".company-name .main-type").html("业务范围：" + localStorage.getItem("scopeBusinessNames"))
        $(".company-name").on("click", function() {
            location.href = "html/mine/mineInformation.html"
        })
        var code = baseConfig.GetQueryString("code")
        if (!code) {
            code = ""
        }

             $.ajax({
                type: "get",
                url: baseConfig.localHttp + "weChatApi/fgclient/getMineList",
                async: false,
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded'
                },
                data: {
                    clientId:SupplierId,
                    openid: code,
                    phone: phone
                },
                success: function(data) {
                    console.log(data)
                    if(!data.content.length || data.content.length==0){
                    	$(".waitNum").html(0)
                    }else{
                    	$(".waitNum").html(data.content.length)
                    }
                   
                },
                error: function() {
                    $.hideLoading();
                }
            })
        $.ajax({
                type: "get",
                url: baseConfig.localHttp2 + "api/order/getOrderList",
                async: false,
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded',
                },
                data: {
                    clientId: SupplierId,
                    pageNumber: 1,
                   
                },
                success: function(data) {
                	if(!data.content.totalCount || data.content.totalCount==0){
                		$(".orderNum").html(0)
                	}else{
                		$(".orderNum").html(data.content.totalCount)
                	}
				
            }
        })
        //
        $.ajax({
			type: "get",
			url: baseConfig.localHttp2 + "weChatApi/fgclient/getPayList",
			async: false,
			headers: {
				'Content-Type': 'application/x-www-form-urlencoded',
			},
			data: {
				clientId:SupplierId
			},
			success: function(data) {
				if(!data.content.length || data.content.length==0){
					$(".applyPay").html(0)
				}else{
					$(".applyPay").html(data.content.length)
				}
			}
		})	
    }
</script>

</html>